package com.shrcl.engineerprocess.web.client.app

import com.google.inject.Inject
import com.google.inject.Provider
import com.shrcl.engineerprocess.web.client.app.resources.MedImages
import com.shrcl.engineerprocess.web.client.workbench.HeaderPresenter
import com.shrcl.engineerprocess.web.client.workbench.ShowEngineerLevelManagementCommand
import edu.fudan.langlab.uidl.domain.app.client.WorkbenchCategoryImpl
import edu.fudan.langlab.uidl.domain.app.client.WorkbenchManager
import com.shrcl.engineerprocess.web.client.workbench.ShowCodeManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowRoleManagementPresenterCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowRoleFunctionAssignmentCommand
import edu.fudan.langlab.uidl.domain.code.client.web.CodeManagementPresenter
import com.shrcl.engineerprocess.web.client.workbench.ShowEngineerManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowCorpWeChatUserManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowEngineerCapabilityManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowCertificationManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowEngineerCertificationCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowEngineerMonthlyCostManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowTSKTaskManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowOwnerTSKTaskManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowServiceRequestFormManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowCostEstimationFormManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowEngineerTrainingManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowTSCWorkLoadTypeManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowTSCServiceTypeManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowTSCProcessRoleManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowCertificationMaintainerByAgencyManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowEngineerProjectManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowEngineerWorkOrderManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowAllEngineerWorkOrderManagementCommand
import com.shrcl.engineerprocess.web.client.engineerproject.ShowEngineerProjectPlanManagementCommand
import com.shrcl.engineerprocess.web.client.workbench.ShowNotificationManagementCommand

class UIWorkbenchPartRegister {
	@Inject WorkbenchManager workbenchManager
	@Inject
	private Provider<CodeManagementPresenter> codeManagerPresenter;
	
	@Inject ShowCodeManagementCommand showCodeManagementCommand
	@Inject ShowRoleManagementPresenterCommand showRoleManagementPresenterCommand
	@Inject ShowRoleFunctionAssignmentCommand showRoleFunctionAssignmentCommand

	@Inject ShowCorpWeChatUserManagementCommand showCorpWeChatUserManagementCommand

	@Inject ShowEngineerManagementCommand showEngineerManagementCommand;
	@Inject ShowEngineerCapabilityManagementCommand showEngineerCapabilityManagementCommand;
	@Inject ShowEngineerMonthlyCostManagementCommand showEngineerMonthlyCostManagementCommand;
	@Inject ShowEngineerTrainingManagementCommand showEngineerTrainingManagementCommand;
	@Inject ShowEngineerCertificationCommand showEngineerCertificationCommand;

	@Inject HeaderPresenter headerPresenter;
	@Inject ShowTSKTaskManagementCommand showTSKTaskManagementCommand;
	@Inject ShowOwnerTSKTaskManagementCommand showOwnerTSKTaskManagementCommand;
	@Inject ShowEngineerLevelManagementCommand showEngineerLevelManagementCommand;
	@Inject ShowCertificationManagementCommand showCertificationManagementCommand;
	
	@Inject ShowServiceRequestFormManagementCommand showServiceRequestFormManagementCommand;
	@Inject ShowCostEstimationFormManagementCommand showCostEstimationFormManagementCommand;
	@Inject ShowTSCWorkLoadTypeManagementCommand showTSCWorkLoadTypeManagementCommand;
	@Inject ShowTSCServiceTypeManagementCommand showTSCServiceTypeManagementCommand;
	@Inject ShowTSCProcessRoleManagementCommand showTSCProcessRoleManagementCommand;
	@Inject ShowCertificationMaintainerByAgencyManagementCommand showCertificationMaintainerByAgencyManagementCommand;
	@Inject ShowEngineerProjectManagementCommand showEngineerProjectManagementCommand;
	@Inject ShowEngineerWorkOrderManagementCommand showEngineerWorkOrderManagementCommand;
	@Inject ShowAllEngineerWorkOrderManagementCommand showAllEngineerWorkOrderManagementCommand;
	
	@Inject ShowEngineerProjectPlanManagementCommand showEngineerProjectPlanManagementCommand
	@Inject ShowNotificationManagementCommand showNotificationManagementCommand
	
	def initialize(){
		val systemManagement = new WorkbenchCategoryImpl("com.shrcl.engineerprocess.web.systemadmin","系统管理",MedImages::INSTANCE.nav5)
		workbenchManager.registerPresenterCategory(systemManagement)
		workbenchManager.registerCommand(systemManagement, showCodeManagementCommand)
		workbenchManager.registerCommand(systemManagement, showRoleManagementPresenterCommand)
		workbenchManager.registerCommand(systemManagement, showRoleFunctionAssignmentCommand)
		workbenchManager.registerCommand(systemManagement, showCertificationManagementCommand)
		workbenchManager.registerCommand(systemManagement, showTSKTaskManagementCommand)
		workbenchManager.registerCommand(systemManagement, showOwnerTSKTaskManagementCommand)
		workbenchManager.registerCommand(systemManagement, showCorpWeChatUserManagementCommand)
		
		workbenchManager.registerHeaderPresenter(headerPresenter)
		
		val engineerManagement = new WorkbenchCategoryImpl("com.shrcl.engineerprocess.web.engineermanagement","工程师管理",MedImages::INSTANCE.nav3)
		workbenchManager.registerPresenterCategory(engineerManagement)
		workbenchManager.registerCommand(engineerManagement, showEngineerLevelManagementCommand)
		workbenchManager.registerCommand(engineerManagement, showEngineerManagementCommand)
		workbenchManager.registerCommand(engineerManagement, showEngineerCapabilityManagementCommand)
		workbenchManager.registerCommand(engineerManagement, showEngineerMonthlyCostManagementCommand)
		workbenchManager.registerCommand(engineerManagement, showEngineerTrainingManagementCommand)
		workbenchManager.registerCommand(engineerManagement, showCertificationMaintainerByAgencyManagementCommand)
		workbenchManager.registerCommand(engineerManagement, showEngineerCertificationCommand)
		
		val costProcessManagement = new WorkbenchCategoryImpl("com.shrcl.engineerprocess.web.costprocessmanagement","TSC预算管理",MedImages::INSTANCE.nav4)
		workbenchManager.registerPresenterCategory(costProcessManagement)
		workbenchManager.registerCommand(costProcessManagement, showTSCProcessRoleManagementCommand)
		workbenchManager.registerCommand(costProcessManagement, showTSCWorkLoadTypeManagementCommand)
		workbenchManager.registerCommand(costProcessManagement, showTSCServiceTypeManagementCommand)
		workbenchManager.registerCommand(costProcessManagement, showServiceRequestFormManagementCommand)
//		workbenchManager.registerCommand(costProcessManagement, showCostEstimationFormManagementCommand)
		
		val engieerProjectManagement = new WorkbenchCategoryImpl("com.shrcl.engineerprocess.web.engineerprojectmanagement","服务项目管理",MedImages::INSTANCE.nav5)
		workbenchManager.registerPresenterCategory(engieerProjectManagement)
		workbenchManager.registerCommand(engieerProjectManagement, showEngineerProjectManagementCommand)
		workbenchManager.registerCommand(engieerProjectManagement, showEngineerWorkOrderManagementCommand)
		workbenchManager.registerCommand(engieerProjectManagement, showAllEngineerWorkOrderManagementCommand)
		
		val engineerProjectPlanManagement = new WorkbenchCategoryImpl("com.shrcl.engineerprocess.web.engineerprocessmanagement","工程师项目",MedImages::INSTANCE.nav3)
		workbenchManager.registerPresenterCategory(engineerProjectPlanManagement)
		workbenchManager.registerCommand(engineerProjectPlanManagement, showEngineerProjectPlanManagementCommand)
		workbenchManager.registerCommand(engineerProjectPlanManagement, showNotificationManagementCommand)
	}	
}


